package com.jzo2o.customer.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.mapper.WorkerCertificationMapper;
import com.jzo2o.customer.model.domain.WorkerCertification;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.WorkerCertificationAuditResDTO;
import com.jzo2o.customer.service.IWorkerCertificationAuitService;
import com.jzo2o.mysql.utils.PageHelperUtils;
import org.springframework.stereotype.Service;

@Service
public class IWorkerCertificationAuitServiceImpl extends ServiceImpl<WorkerCertificationMapper, WorkerCertification> implements IWorkerCertificationAuitService {


    @Override
    public PageResult<WorkerCertificationAuditResDTO> pages(WorkerCertificationAuditPageQueryReqDTO workerCertificationAuditPageQueryReqDTO) {
        //获取查询参数
        Integer auditStatus = workerCertificationAuditPageQueryReqDTO.getAuditStatus();
        Integer certificationStatus = workerCertificationAuditPageQueryReqDTO.getCertificationStatus();
        String idCardNo = workerCertificationAuditPageQueryReqDTO.getIdCardNo();
        String name = workerCertificationAuditPageQueryReqDTO.getName();

        return PageHelperUtils.selectPage(workerCertificationAuditPageQueryReqDTO,
                () -> baseMapper.queryList(auditStatus, certificationStatus, idCardNo, name));
    }
}
